import request from '@/utils/request'

// 商品列表
export function apiGoodsList(params) {
    return request({
        url: '/gmsGoods/list',
        method: 'get',
        params
    })
}

// 商品详情
export function apiGoodsDetail(params) {
    return request({
        url: '/gmsGoods/detail/' + params,
        method: 'get',
    })
}

// 商品审核
export function apiGoodsAudit(params, data) {
    return request({
        url: '/gmsGoods/audit/' + params,
        method: 'post',
        params: data
    })
}

// 下架商品
export function apiGoodsBan(params, data) {
    return request({
        url: '/gmsGoods/ban/' + params,
        method: 'post',
        params: data
    })
}

// 恢复被下架商品
export function apiGoodsBanRestore(params) {
    return request({
        url: '/gmsGoods/restore/' + params,
        method: 'post',
    })
}

// 标签列表
export function apiTagList(params) {
    return request({
        url: '/gmsTag/list',
        method: 'get',
        params
    })
}

// 获取标签的一级分类
export function apiTagCate() {
    return request({
        url: '/gmsCategory/listParent',
        method: 'get'
    })
}

// 新增标签
export function apiTagAdd(data) {
    return request({
        url: '/gmsTag/create',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 编辑标签
export function apiTagEdit(data) {
    return request({
        url: '/gmsTag/update',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 禁用/启用标签
export function apiTagEditStatus(params, data) {
    return request({
        url: '/gmsTag/updateStatus/' + params,
        method: 'post',
        params: data
    })
}

// 删除标签
export function apiTagDel(params) {
    return request({
        url: '/gmsTag/delete/' + params,
        method: 'post',
    })
}

// 所有的服务保障
export function apiAllGuarantee() {
    return request({
        url: '/gmsGuarantee/listAll',
        method: 'get',
    })
}

// 服务保障列表
export function apiGuaranteeList(params) {
    return request({
        url: '/gmsGuarantee/list',
        method: 'get',
        params
    })
}

// 新增服务保障
export function apiGuaranteeAdd(data) {
    return request({
        url: '/gmsGuarantee/create',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 编辑服务保障
export function apiGuaranteeEdit(data) {
    return request({
        url: '/gmsGuarantee/update',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 禁用/启用服务保障
export function apiGuaranteeEditStatus(params, data) {
    return request({
        url: '/gmsGuarantee/updateStatus/' + params,
        method: 'post',
        params: data
    })
}

// 删除服务保障
export function apiGuaranteeDel(params) {
    return request({
        url: '/gmsGuarantee/delete/' + params,
        method: 'post',
    })
}

// 所有的配送服务
export function apiAllDelivery() {
    return request({
        url: '/gmsDelivery/listAll',
        method: 'get',
    })
}

// 配送服务列表
export function apiDeliveryList(params) {
    return request({
        url: '/gmsDelivery/list',
        method: 'get',
        params
    })
}

// 新增配送服务
export function apiDeliveryAdd(data) {
    return request({
        url: '/gmsDelivery/create',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 编辑配送服务
export function apiDeliveryEdit(data) {
    return request({
        url: '/gmsDelivery/update',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    })
}

// 禁用/启用配送服务
export function apiDeliveryEditStatus(params, data) {
    return request({
        url: '/gmsDelivery/updateStatus/' + params,
        method: 'post',
        params: data
    })
}

// 删除配送服务
export function apiDeliveryDel(params) {
    return request({
        url: '/gmsDelivery/delete/' + params,
        method: 'post',
    })
}